﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace cstdx.Proto.Std;

/// <summary>
/// 财务信息响应结构
/// </summary>
public class FinanceInfoResponse
{
	/// <summary>
	/// 财务信息实体
	/// </summary>
	public FinanceInfo Info { get; set; } = new FinanceInfo();

	/// <summary>
	/// 从字节数组反序列化
	/// </summary>
	/// <param name="data">原始响应数据</param>
	public void Unmarshal(byte[] data)
	{
		var raw = new FinanceInfoResponseRaw();
		raw.Unmarshal(data);

		// 转换原始数据为处理后的数据（float32转float64，并乘以10000）
		Info.LiuTongGuBen = (double)raw.LiuTongGuBen * 10000;
		Info.Province = raw.Province;
		Info.Industry = raw.Industry;
		Info.UpdatedDate = raw.UpdatedDate;
		Info.IPODate = raw.IPODate;
		Info.ZongGuBen = (double)raw.ZongGuBen * 10000;
		Info.GuoJiaGu = (double)raw.GuoJiaGu * 10000;
		Info.FaQiRenFaRenGu = (double)raw.FaQiRenFaRenGu * 10000;
		Info.FaRenGu = (double)raw.FaRenGu * 10000;
		Info.BGu = (double)raw.BGu * 10000;
		Info.HGu = (double)raw.HGu * 10000;
		Info.ZhiGongGu = (double)raw.ZhiGongGu * 10000;
		Info.ZongZiChan = (double)raw.ZongZiChan * 10000;
		Info.LiuDongZiChan = (double)raw.LiuDongZiChan * 10000;
		Info.GuDingZiChan = (double)raw.GuDingZiChan * 10000;
		Info.WuXingZiChan = (double)raw.WuXingZiChan * 10000;
		Info.GuDongRenShu = (double)raw.GuDongRenShu;
		Info.LiuDongFuZhai = (double)raw.LiuDongFuZhai * 10000;
		Info.ChangQiFuZhai = (double)raw.ChangQiFuZhai * 10000;
		Info.ZiBenGongJiJin = (double)raw.ZiBenGongJiJin * 10000;
		Info.JingZiChan = (double)raw.JingZiChan * 10000;
		Info.ZhuYingShouRu = (double)raw.ZhuYingShouRu * 10000;
		Info.ZhuYingLiRun = (double)raw.ZhuYingLiRun * 10000;
		Info.YingShouZhangKuan = (double)raw.Yingshouzhangkuan * 10000;
		Info.YingyeLiRun = (double)raw.YingyeLiRun * 10000;
		Info.TouZiShouYu = (double)raw.TouZiShouYu * 10000;
		Info.JingYingxianJinLiu = (double)raw.JingYingxianJinLiu * 10000;
		Info.ZongXianJinLiu = (double)raw.ZongXianJinLiu * 10000;
		Info.CunHuo = (double)raw.CunHuo * 10000;
		Info.LiRunZongHe = (double)raw.LiRunZongHe * 10000;
		Info.ShuiHouLiRun = (double)raw.ShuiHouLiRun * 10000;
		Info.JingLiRun = (double)raw.JingLiRun * 10000;
		Info.WeiFenLiRun = (double)raw.WeiFenLiRun * 10000;
		Info.MeiGuJingZiChan = (double)raw.BaoLiu1 * 10000;
		Info.BaoLiu2 = (double)raw.BaoLiu2;
	}
}

